<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>系统登录 - 超市账单管理系统</title>
    <link rel="stylesheet" href="../css/style.css"/>
    <script type="text/javascript" src="/js/jquery-1.12.4.js"></script>
    <script>
            function aj() {
                var user=$("#user").val();
                var pwd=$("#mima").val();

               var url="/UserServlet?action=login";
                $.ajax({
                    type:"get",
                    url:url,
                    data:{"user":user,"pwd":pwd},
                    success:function(data){
                        if(data=="true"){
                            window.location.href ="/UserServlet?action=success";

                        }else {

                            $("#sss").text("账号密码错误");
                        }
                    },
                    error :function () {
                        alert(11);
                    }
                });
            }

    </script>

</head>
<body class="login_bg">
    <section class="loginBox">
        <header class="loginHeader">
            <h1>超市账单管理系统</h1>
        </header>
        <section class="loginCont">
            <form class="loginForm"  method="post">
                <div class="inputbox">
                    <label for="user">用户名：</label>
                    <input id="user" type="text" name="username" value="123456" placeholder="请输入用户名" required/>
                </div>
                <div class="inputbox">
                    <label for="mima">密码：</label>
                    <input id="mima" type="password" name="password" value="123123" placeholder="请输入密码" required/>
                </div>
                <div class="subBtn">
                    <input onclick="aj()" type="button" value="登录" />
                    <input type="reset" value="重置"/>
                </div>
                     <p id="sss" style="margin-left: 120px ;color: red"></p>
            </form>
        </section>
    </section>

</body>
</html>